package com.axc.gallery2.dbhelper;

import java.io.File;
import java.io.Serializable;
import java.util.List;

import android.R.integer;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

public class ImageInfo implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = -7311140269355309291L;
	private String iName = "";
	private long iLenth = 0;
	private String iLocation = "";
	private List<integer> inAblum ;
	private boolean iExists = false;
	private int iHeight = 0;
	private int iWidch = 0;
	public final static String POSITION = "position";
	public final static String IAMGEPATH = "imagepath";
	
	public String image_id;
	
	public String image_path;
	
	public String getILocation() {
		return iLocation;
	}
	public boolean getExists() {
		return iExists;
	}
	public String getiName() {
		return iName;
	}

	public List<integer> getInAblum() {
		return inAblum;
	}

	public long getILenth() {
		return iLenth;
	}

	public int getIWidch() {
		return iWidch;
	}

	public int getIHeight() {
		return iHeight;
	}
	
	public ImageInfo(){
		
	}

	public ImageInfo(String path)  {
		try {
			File file = new File(path);
			if (file.exists()) {
				iName = file.getName();
				iLocation = path;
				iExists = true;
				iLenth = file.length()/1024;
		        BitmapFactory.Options options = new BitmapFactory.Options();
		        options.inSampleSize = 10;
				Bitmap bitmap =BitmapFactory.decodeFile(path,options);
				iWidch = bitmap.getWidth();
				iHeight = bitmap.getHeight();
				if(!bitmap.isRecycled()){
					bitmap.recycle();
				}
				
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}
	



}
